<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Java实训课程 - 注册</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="libs/handlebars.min.js"></script>
<script type="text/javascript" src="libs/getQueryString.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h2 class="text-center">
					<strong>你瞅瞅记账</strong>
				</h2>
			</div>
			<div class="col-md-8">
				<ul class="nav nav-pills">
					<li class=""><a href="index.html">首页</a></li>
					<li><a href="#">用户：<span id="account"></span></a></li>
					<li class=""><a href="shouru.html">添加新的收入</a></li>
					<li class=""><a href="zichu.html">添加新的支出</a></li>
					<li class=""><a href="jizhang.html">添加新的</a></li>
					<li class=""><a href="chaxun.html">统计</a></li>
					<li class=""><a href="tongji.html">查询</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-primary">
					<div class="panel-heading">
						<h4>详细信息</h4>
					</div>
					<div class="panel-body" id="list1"></div>
					<button id="del" class="btn btn-primary btn-block">删除</button>
				</div>
			</div>
		</div>
	</div>
	<script id="template" type="text/x-handlebars-template">
   {{#each item}}
  <div class="panel panel-default col-md-4">
    <div class="panel-body"> 
     <dl>
       <dt>ID</dt><dd>{{id}}</dd>
     
       <dt>地址</dt><dd>{{place}}</dd>
       <dt>收入金额</dt><dd>{{money_in}}</dd>
       <dt>支出金额</dt><dd>{{money_out}}</dd>
       <dt>类别</dt><dd>{{kind}}</dd>
       <dt>备注</dt><dd>{{remark}}</dd>
    </dl>
   </div>
  </div>
 {{/each}}
</script>
</body>
<script type="text/javascript">
	$(function() {
		$.getJSON('querynickname.action', function(res) {
			console.log(res);
			$('#account').text(res.nickname);
		})
		$('#del').click(function() {
			$.post('deleteONE.action', {
				id : id
			}, function(res, status) {
				if ("del" == res) {
					alert("删除成功")
				}
			})
		})
		var id = getQueryString('id');
		var url = 'queryone.action?id=' + id;
		$.getJSON(url, function(res) {
			var date = {
				'item' : res
			};
			var t = Handlebars.compile($('#template').html());
			$('#list1').html(t(date));
		})

	})
</script>
</html>